﻿using ReAnimation.Domain;

namespace ReAnimation.Graphics.Handlers.TwoAtomsSelect.States
{
    class SecondAtomSelectState: BaseState
    {
        public SecondAtomSelectState(TwoAtomsSelectHandler handler) : base(handler)
        {

        }

        public override void AtomSelected(Atom atom)
        {
            if(atom == Handler.FirstSelectedAtom)
            {
                Handler.CurrentStateType = TwoAtomsSelectStates.FirstAtomSelect;
                return;
            }
            Handler.SecondSelectedAtom = atom;
            Handler.MoleculeDrawer.EmphasizeAtom(atom, Handler.SecondSelectedAtomEmphasizeParams);
            Handler.SelectionFinished();
            Handler.CurrentStateType = TwoAtomsSelectStates.FirstAtomSelect;
        }
    }
}